import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: mirac
 * Date: 2025-07-26
 * Time: 23:34
 */
class Alg {
    public <E> void Swap(E[] arrays,int i,int j) {
        E t = arrays[i];
        arrays[i] = arrays[j];
        arrays[j] = t;
    }
}

public class Main {
    public static void main(String[] args) {
        Integer[] arrays = {1,2,4,3};
        Alg alg = new Alg();

        alg.<Integer>Swap(arrays,2,3);
        System.out.println(Arrays.toString(arrays));
    }
}
